import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state= {
    httpError: {
        hasError: false,
        status: '',
        statusText: ''
    },
    tokenInfo: {
        isLogin: false,
        token: "",
        expire: undefined,
        tenant: undefined
    }
}

const mutations= {
    ON_HTTP_ERROR(state, payload) {
        state.hasError = payload
    },
    ON_TENANT_STATE(state, payload){
        state.tokenInfo= payload
    }
}

export default new Vuex.Store({
    state,
    mutations
})